package com.example.personalmemo.Util;

import com.example.personalmemo.recordInfo.RecordInfo;
import ohos.data.resultset.ResultSet;

import java.util.ArrayList;
import java.util.List;

public class ResultUtil {


    public static List<RecordInfo> getRecordList(ResultSet resultSet){
        List<RecordInfo> list = new ArrayList<>();

        while(resultSet.goToNextRow()){
            RecordInfo record = new RecordInfo();
            record.setId(resultSet.getInt(0));
            record.setTitle(resultSet.getString(1));
            record.setTextinfo(resultSet.getString(2));
            record.setTime(resultSet.getString(3));

            list.add(record);
        }
        return list;
    }
}
